Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODStorageUnit


GetWeakStorageUnitRef

The GetWeakStorageUnitRef method creates a weak persistent reference to the specified storage unit.

void GetWeakStorageUnitRef (
                           in ODStorageUnitID embeddedSUID, 
                           out ODStorageUnitRef weakRef);
embeddedSUID
The storage-unit ID of the storage unit whose persistent reference is desired.
weakRef
The persistent reference to the storage unit specified by the embeddedSUID parameter.
DISCUSSION
Before you call this method, you should focus this storage unit on the value where you want to store the weak persistent reference. After this method executes successfully, call the SetValue method to store the resulting persistent reference, returned in the weakRef output parameter, into the currently focused value.

IMPORTANT
The scope of a persistent reference is limited to the value in which it was created. If you store the persistent reference in a different value, it will almost certainly not refer to the correct storage unit.
EXCEPTIONS
kODErrIllegalNullStorageUnitInput
The embeddedSUID parameter is null.
kODErrUnfocusedStorageUnit
This storage unit is not focused on a value.
kODErrZeroRefCount
This storage unit has a reference count of 0.
SEE ALSO
The ODStorageUnitID type (page 903).
The ODStorageUnitRef type (page 903).
The ODStorageUnit::GetStrongStorageUnitRef method (page 696).
The ODStorageUnit::IsWeakStorageUnitRef method (page 705).
The ODStorageUnit::SetValue method (page 714).
For more information on persistent references, see the chapter on storage in the OpenDoc Programmer's Guide for the MacOS.
Listing 2-43 on page 103 in OpenDoc Cookbook.
Listing 2-47 on page 110 in OpenDoc Cookbook.
"Creating Persistent References" on page 281 in OpenDoc Programmer's Guide.
"Persistent References and Cloning" on page 282 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help